<include file="public:top" />
<!--网站设置-->
<body class="body">
<style type="text/css">
    .red {color: #FF5722!important;}
    .green {color: #5FB878!important;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>{$menuid|getmenuname}</legend>
</fieldset>
<form class="layui-form layui-form-pane" action="">
    <input type="hidden" name="g" value="admin" />
    <input type="hidden" name="m" value="forum" />
    <input type="hidden" name="a" value="index" />
    <input type="hidden" name="menuid" value="{$menuid}" />
     <div class="my-btn-box">
     <span class="fl">
        <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">板块</label>
              <div class="layui-input-inline">
                <select name="cate_id">
                  <option value="">请选择</option>
                  <volist name="catelist" id="val" >
                    <option value="{$val.id}" <if condition="$pid eq $val['id']"> selected=""</if>>{$val.name}</option>
                  </volist>
                 </select>
              </div>
               <label class="layui-form-label">{:L('keyword')}</label>
              <div class="layui-input-inline">
                <input type="tel" name="keyword" placeholder="关键词" value="{$search.keyword}" class="layui-input">
              </div>
              <div class="layui-input-inline">
                 <button class="layui-btn mgl-20">搜索</button>
                 <a href="{:U('index', array('menuid'=>$menuid))}" class="layui-btn layui-btn-primary mgl-20">显示全部</a>
              </div>
            </div>
        </div>
     </span>
     <span class="fr">
       <a class="layui-btn layui-btn-danger" id="btn-alldel">批量删除</a>
       <a href="{:U('forum/add')}" class="layui-btn layui-btn-normal" id="btn-add">添加帖子</a>
     </span>
    </div> 
</form>
<form class="layui-form layui-form-pane" action="">
    <table class="layui-table">
        <colgroup>
            <col width="60">
            <col width="60">
            <col width="">
            <col width="100">
            <!-- <col width="100"> -->
            <col width="200">
            <col width="100">
            <col width="100">
        </colgroup>
        <thead>
        <tr>
            <th><input type="checkbox" id="checkall_t" lay-skin="primary" lay-filter="allChoose" ></th>
            <th>ID</th>
            <th>帖子标题</th>
            <th>板块</th>
            <!-- <th>{:L('author')}</th> -->
            <th>{:L('publish_time')}</th>
            <th>置顶</th>
            <th>管理操作</th>
        </tr>
        </thead>
         <tbody id="userList">
            <volist name="list" id="val" >
              <tr>
                <td><input class="doc_checkbox" type="checkbox" value="{$val.id}" lay-skin="primary" lay-filter="itemChoose"></td>
                <td>{$val.id}</td>
                <td>{$val.title}</td>
                <td>{$cate_list[$val['cateid']]}</td>
                <td>{$val.add_time|date='Y-m-d H:i:s',###}</td>
                <td>
                   <input type="checkbox" value="{$val.top}" data-uri="{:U('forum/ajax_edit',array('field'=>'top','id'=>$val['id']))}" lay-skin="switch" lay-filter="status" lay-text="启用|禁止" <if condition="$val.top eq 1">checked </if>>
                 </td>
                <td><a href="{:u('forum/edit', array('id'=>$val['id'], 'menuid'=>$menuid))}">{:L('edit')}</a> | <a href="javascript:void(0);" class="J_confirmurl" id="delete" data-acttype="ajax" data-uri="{:u('forum/delete', array('id'=>$val['id']))}" data-msg="{:sprintf(L('confirm_delete_one'),$val['title'])}">{:L('delete')}</a></td>
              </tr>
            </volist>
        </tbody>

    </table>
</form>
<div id="test-laypage-demo0">
  <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-29">
  {$page}
  </div>
</div>
<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
layui.use(['layer','jquery','form','element','table'], function () {
    //参数：layui、名称、模块名、主键（删除用）
    Oper.initList(layui, '帖子', 'forum', 'id');
});
</script>
</body>
</html>